<!DOCTYPE html>
<html>
<head>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>湛江潜校</title>
<!-- Tell the browser to be responsive to screen width -->
<meta
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
	name="viewport">
<!-- Bootstrap 3.3.5 -->
<link rel="stylesheet"
	href="<c:url value="/bootstrap/css/bootstrap.min.css"/>" />
<!-- Font Awesome -->
<link rel="stylesheet"
	href="<c:url value="/dist/css/font-awesome.min.css"/>" />
<!-- Ionicons -->
<link rel="stylesheet"
	href="<c:url value="/dist/css/ionicons.min.css"/>" />
<!-- Theme style -->
<link rel="stylesheet"
	href="<c:url value="/dist/css/AdminLTE.min.css"/>" />
<!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet"
	href="<c:url value="/dist/css/skins/_all-skins.min.css"/>" />
<!-- iCheck -->
<link rel="stylesheet"
	href="<c:url value="/plugins/iCheck/flat/blue.css"/>" />
<!-- Morris chart -->
<link rel="stylesheet"
	href="<c:url value="/plugins/morris/morris.css"/>" />
<!-- jvectormap -->
<link rel="stylesheet"
	href="<c:url value="/plugins/jvectormap/jquery-jvectormap-1.2.2.css"/>" />
<!-- Date Picker -->
<link rel="stylesheet"
	href="<c:url value="/plugins/datepicker/datepicker3.css"/>" />
<!-- Daterange picker -->
<link rel="stylesheet"
	href="<c:url value="/plugins/daterangepicker/daterangepicker-bs3.css"/>" />
<!-- bootstrap wysihtml5 - text editor -->
<link rel="stylesheet"
	href="<c:url value="/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css"/>" />

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
        <script src="<c:url value="/dist/js/html5shiv.min.js"/>"></script>
        <script src="<c:url value="/dist/js/respond.min.js"/>"></script>
    <![endif]-->
</head>
<body class="hold-transition skin-blue sidebar-mini">
	<div class="wrapper">

		<header class="main-header">
			<!-- Logo -->
			<a href="../index.html" class="logo"> <!-- mini logo for sidebar mini 50x50 pixels -->
				<span class="logo-mini"><b>ZJ</b>QX</span> <!-- logo for regular state and mobile devices -->
				<span class="logo-lg"><b>湛江</b>潜校</span>
			</a>
			<!-- Header Navbar: style can be found in header.less -->
			<nav class="navbar navbar-static-top" role="navigation">
				<!-- Sidebar toggle button-->
				<a href="#" class="sidebar-toggle" data-toggle="offcanvas"
					role="button"> <span class="sr-only">Toggle navigation</span>
				</a>
			</nav>
		</header>
		<!-- Left side column. contains the logo and sidebar -->
		<aside class="main-sidebar">
			<!-- sidebar: style can be found in sidebar.less -->
			<section class="sidebar">
				<!-- /.search form -->
				<!-- sidebar menu: : style can be found in sidebar.less -->
				<ul class="sidebar-menu">
					<li class="header">主菜单</li>
					<!-- 药房管理员 -->
					<c:if test="${permission==3}">
						<li class="treeview"><a href="#"> <i
								class="fa fa-files-o"></i> <span>药品管理</span> <i
								class="fa fa-angle-left pull-right"></i>
						</a>
							<ul class="treeview-menu">
								<li><a href="${ctp }/drugManager/addDrug"><i
										class="fa fa-circle-o">新建药品</i></a></li>
								<li><a href="${ctp }/drugManager/getDrugList"><i
										class="fa fa-circle-o">药品列表</i></a></li>
								<li><a href="../medicine/inventoryMedicineNotice.html"><i
										class="fa fa-circle-o">库存警戒线药品</i></a></li>
								<li><a href="../medicine/expiredMedicine.html"><i
										class="fa fa-circle-o">药品报损表</i></a></li>
								<li><a href="../medicine/deliverMedicine.html"><i
										class="fa fa-circle-o">物资发放</i></a></li>
								<li><a href="../medicine/deliverList.html"><i
										class="fa fa-circle-o">物资发放列表</i></a></li>
							</ul></li>
						<li class="treeview"><a href="#"> <i
								class="fa fa-files-o"></i> <span> 缴费管理</span> <i
								class="fa fa-angle-left pull-right"></i>
						</a>
							<ul class="treeview-menu">
								<li><a href="../pay/registeredList.html"><i
										class="fa fa-circle-o">挂号</i></a></li>
								<li><a href="../pay/payList.html"><i
										class="fa fa-circle-o">处方缴费</i></a></li>
								<li><a href="../pay/refundList.html"><i
										class="fa fa-circle-o">处方退费</i></a></li>
								<li><a href="../pay/registeredStatistics.html"><i
										class="fa fa-circle-o">挂号统计</i></a></li>
								<li><a href="../pay/paymentStatistics.html"><i
										class="fa fa-circle-o">缴费统计</i></a></li>
								<li><a href="../pay/refundStatistics.html"><i
										class="fa fa-circle-o">退费统计</i></a></li>
							</ul></li>
						<li class="treeview"><a href="#"> <i
								class="fa fa-dashboard"></i> <span>医疗卡管理</span> <i
								class="fa fa-angle-left pull-right"></i>
						</a>
							<ul class="treeview-menu">
								<li><a href="${ctp }/drugManager/addPatient"><i
										class="fa fa-circle-o"></i>新办医疗卡</a></li>
								<li><a href="${ctp }/drugManager/getPatientList"><i
										class="fa fa-circle-o"></i>医疗卡列表</a></li>
								<li><a href="../card/cardSearch.html"><i
										class="fa fa-circle-o"></i>医疗卡查询</a></li>
							</ul></li>
					</c:if>
					<!-- 医生 -->
					<c:if test="${permission==2}">
						<li class="treeview"><a href="#"> <i
								class="fa fa-files-o"></i> <span>处方管理</span> <i
								class="fa fa-angle-left pull-right"></i>
						</a>
							<ul class="treeview-menu">
								<li><a href=""><i class="fa fa-circle-o"></i>查看处方</a></li>
								<li><a href="${ctp }/doctor/addRecipe"><i
										class="fa fa-circle-o"></i>添加处方</a></li>
								<li><a href="${ctp }/doctor/getRecipeList"><i
										class="fa fa-circle-o"></i>处方列表</a></li>
							</ul></li>
					</c:if>
					<!-- 导医 -->
					<c:if test="${permission==4}">
						<li class="treeview"><a href="#"> <i
								class="fa fa-files-o"></i> <span>绩效统计</span> <i
								class="fa fa-angle-left pull-right"></i>
						</a>
							<ul class="treeview-menu">
								<li><a href="../finance/personalWorkload.html"><i
										class="fa fa-circle-o">个人工作量统计</i></a></li>
								<li><a href="../finance/performance.html"><i
										class="fa fa-circle-o">绩效统计</i></a></li>
							</ul></li>
						<li><a href="../prescription/showPrescription.html"><i
								class="fa fa-circle-o"></i>查看处方</a></li>
					</c:if>



					<!-- 超级管理员 -->
					<c:if test="${permission==5 }">
						<li class="treeview"><a href="#"> <i
								class="fa fa-files-o"></i> <span> 用户管理</span> <i
								class="fa fa-angle-left pull-right"></i>
						</a>
							<ul class="treeview-menu">
								<li><a href="${ctp }/superUser/addUser"><i
										class="fa fa-circle-o">新增用户</i></a></li>
								<li><a href="${ctp }/superUser/getUsers"><i
										class="fa fa-circle-o">用户列表</i></a></li>
							</ul></li>
						<li class="treeview"><a href="#"> <i
								class="fa fa-files-o"></i> <span> 治疗管理</span> <i
								class="fa fa-angle-left pull-right"></i>
						</a>
							<ul class="treeview-menu">
								<li><a href="${ctp }/superUser/addCureList"><i
										class="fa fa-circle-o">新建治疗项目</i></a></li>
								<li><a href="../project/addPhysicalExamination.html"><i
										class="fa fa-circle-o">新建体格诊断</i></a></li>
								<li><a href="${ctp }/superUser/getCureList"><i
										class="fa fa-circle-o">治疗项目列表</i></a></li>
								<li><a href="../project/physicalExaminationList.html"><i
										class="fa fa-circle-o">体格诊断列表</i></a></li>
							</ul></li>
					</c:if>

				</ul>
			</section>
			<!-- /.sidebar -->
		</aside>

		<!-- 主体部分 START -->

		<div class="content-wrapper">
			<!-- Content Header (Page header) -->
			<section class="content-header">
				<h1>修改药品</h1>
			</section>

			<section class="content">
				<form:form modelAttribute="drug"
					action="${ctp }/drugManager/updateDrug" id="form" role="form">
					<div class="box-body">
						<div class="form-group">
							<label for="">一级类型</label>
							<div style="">
								<form:select path="lastdrugid" class="form-control"
									style="width:200px;display:inline-block;">
									<c:forEach items="${drugsForLevelOne }" var="drugForLevelOne">
										<form:option value="${drugForLevelOne.drugid }">
											<c:out value="${drugForLevelOne.drugname }"></c:out>
										</form:option>
									</c:forEach>
								</form:select>
							</div>
						</div>
						<div class="form-group">
							<label for="">助记码</label><span class="notice" style="color:red;"></span>
							<form:input path="mnemoniccode" class="form-control" id="mnemoniccode"
								type="text" />
						</div>
						<div class="form-group">
							<label for="">编码</label><span class="notice" style="color:red;"></span>
							<form:input path="encode" class="form-control" id="encode" type="text" />
						</div>
						<div class="form-group">
							<label for="">药品名称</label><span class="notice" style="color:red;"></span>
							<form:input path="drugname" class="form-control" id="drugname"
								type="text" />
							<form:hidden path="druglevel" value="2" />
							<form:hidden path="drugid" />

						</div>
						<div class="form-group">
							<label for="">规格</label><span class="notice" style="color:red;"></span>
							<form:input path="standard" class="form-control" id="standard"
								type="text" />
						</div>
						<div class="form-group">
							<label for="">生产厂家</label><span class="notice" style="color:red;"></span>
							<form:input path="producter" class="form-control" id="producter"
								type="text" />
						</div>
						<div class="form-group">
							<label for="">药品数量</label><span class="notice" style="color:red;"></span>
							<form:input path="drugcount" class="form-control" id="drugcount"
								type="number" />
						</div>
						<div class="form-group">
							<label for="">单位</label><span class="notice" style="color:red;"></span>
							<form:input path="type" class="form-control" id="type" type="text" />
						</div>
						<div class="form-group">
							<label for="">单价</label><span class="notice" style="color:red;"></span>
							<form:input path="price" class="form-control" id="price" type="number" />
						</div>
						<div class="form-group">
							<label for="">进货价</label><span class="notice" style="color:red;"></span>
							<form:input path="cost" class="form-control" id="cost" type="number" />
						</div>
						<div class="form-group">
							<label for="">生产批号</label><span class="notice" style="color:red;"></span>
							<form:input path="batchnumber" class="form-control" id="batchnumber"
								type="number" />
						</div>
						<div class="form-group">
							<label for="">生产日期</label><span class="notice" style="color:red;"></span>
							<form:input path="validdate" class="form-control" id="validdate"
								type="text" />
						</div>
						<div class="form-group">
							<label for="">过期日期</label><span class="notice" style="color:red;"></span>
							<form:input path="expdate" class="form-control" id="expdate" type="text" />
						</div>
						<div class="form-group">
							<label for="">批准文号</label><span class="notice" style="color:red;"></span>
							<form:input path="approvalmark" class="form-control" id="approvalmark"
								type="text" />
						</div>
						<div class="form-group">
							<label for="">条形码</label><span class="notice" style="color:red;"></span>
							<form:input path="barcode" class="form-control" id="barcode"
								type="number" />
						</div>
						<div class="form-group">
							<label for="">药品警戒线数量</label><span class="notice" style="color:red;"></span>
							<form:input path="deadnumber" class="form-control" id="deadnumber"
								type="number" />
						</div>

					</div>
					<!-- /.box-body -->

					<div class="box-footer">
						<button id="submit" class="btn btn-primary">修改</button>
						<a href="${ctp}/drugManager/getDrugList">&nbsp;返回</a>
					</div>
				</form:form>
			</section>
			<!-- /.Left col -->
		</div>

		<!-- 主体部分 END -->



		<footer class="main-footer">
			<div class="pull-right hidden-xs">
				<b>Version</b> 1.0.0
			</div>
			<strong>Copyright &copy; 2015-2015 湛江潜校 .</strong> All rights
			reserved.
		</footer>

		<!-- Add the sidebar's background. This div must be placed
           immediately after the control sidebar -->
		<div class="control-sidebar-bg"></div>
	</div>
	<!-- ./wrapper -->

	<!-- jQuery 2.1.4 -->
	<script src="<c:url value="/plugins/jQuery/jQuery-2.1.4.min.js"/>"></script>
	<!-- jQuery UI 1.11.4 -->
	<script src="<c:url value="/dist/js/jquery-ui.min.js"/>"></script>
	<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
	<script src="<c:url value="/dist/js/hospital.js"/>"></script>
	<script>
		$.widget.bridge('uibutton', $.ui.button);
		
	      /* 本页面验证 */
	      STATUS={};
	      STATUS.mnemoniccode = true;
	      STATUS.encode = true;
	      STATUS.drugname = true;
	      STATUS.standard = true;
	      STATUS.producter = true;
	      STATUS.drugcount = true;
	      STATUS.type = true;
	      STATUS.price = true;
	      STATUS.cost = true;
	      STATUS.batchnumber = true;
	      STATUS.validdate = true;
	      STATUS.expdate = true;
	      STATUS.approvalmark = true;
	      STATUS.deadnumber = true;

	      $(document).ready(function() {
	    	$('#mnemoniccode').blur(function(){
	    		$.isNotNull('mnemoniccode','#mnemoniccode','请输入助记码');
	        }),
	        $('#encode').blur(function(){
	        	$.isNotNull('encode','#encode','请输入编码');
	        }),
	      	$('#drugname').change(function(){
	      		$.isNotNull('drugname','#drugname','请输入药品名');
	      	}),
	      	$('#standard').change(function(){
	      		$.isNotNull('standard','#standard','请输入规格');
	      	}),
	      	$('#producter').change(function(){
	      		$.isNotNull('producter','#producter','请输入生产厂家');
	      	}),
	      	$('#drugcount').change(function(){
	      		$.isNotNull('drugcount','#drugcount','请输入药品数！');
	      		$.isValid('drugcount','#drugcount',regNumber,'请输入正确的药品数量！');
	      	}),
	      	$('#type').change(function(){
	      		$.isNotNull('type','#type','请输入单位');
	      	}),
	      	$('#price').change(function(){
	      		$.isNotNull('price','#price','请输入单价');
	      		$.isValid('price','#price',regFloat,'请输入正确的单价');
	      	}),
	      	$('#cost').change(function(){
	      		$.isNotNull('cost','#cost','请输入进货价');
	      		$.isValid('cost','#cost',regFloat,'请输入正确的进货价');
	      	}),
	      	$('#batchnumber').change(function(){
	      		$.isNotNull('batchnumber','#batchnumber','请输入生产批号');
	      	}),
	      	$('#validdate').change(function(){
	      		$.isNotNull('validdate','#validdate','请输入日期');
	      		$.isValid('validdate','#validdate',regShortDate,'请输入正确的日期格式！（2015-01-01）');
	      	}),
	      	$('#expdate').change(function(){
	      		$.isNotNull('expdate','#expdate','请输入日期');
	      		$.isValid('expdate','#expdate',regShortDate,'请输入正确的日期格式！（2015-01-01）');
	      	}),
	      	$('#approvalmark').change(function(){
	      		$.isNotNull('approvalmark','#approvalmark','请输入批准文号');
	      	}),
	      	$('#deadnumber').change(function(){
	      		$.isNotNull('deadnumber','#deadnumber','请输入药品警戒线数量！');
	      		$.isValid('deadnumber','#deadnumber',regWholeNumber,'请输入药品警戒线数量！（正整数）');
	      	}),
	      	$('#submit').click(function(){
	      		if(STATUS.mnemoniccode&&STATUS.encode &&STATUS.drugname &&STATUS.standard &&STATUS.producter &&STATUS.drugcount &&STATUS.type  &&STATUS.price  &&STATUS.cost  &&STATUS.batchnumber  &&STATUS.validdate  &&STATUS.expdate  &&STATUS.approvalmark &&STATUS.deadnumber ){
	      			$('#form').submit();
	      		}else{
	      			alert('有不合法输入，请重新检查。');
	      			/* alert(STATUS.mnemoniccode+","+STATUS.encode +","+STATUS.drugname +","+STATUS.standard +","+STATUS.producter +","+STATUS.drugcount+","+STATUS.type  +","+STATUS.price +","+STATUS.cost  +","+STATUS.batchnumber  +","+STATUS.validdate  +","+STATUS.expdate +","+STATUS.approvalmark+","+STATUS.deadnumber) */
	      			return false;
	      		}
	      	})
	      })
	</script>
	<!-- Bootstrap 3.3.5 -->
	<script src="<c:url value="/bootstrap/js/bootstrap.min.js"/>"></script>
	<!-- Morris.js charts -->
	<script src="<c:url value="/dist/js/raphael-min.js"/>"></script>
	<script src="<c:url value="/plugins/morris/morris.min.js"/>"></script>
	<!-- Sparkline -->
	<script
		src="<c:url value="/plugins/sparkline/jquery.sparkline.min.js"/>"></script>
	<!-- jvectormap -->
	<script
		src="<c:url value="/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"/> "></script>
	<script
		src="<c:url value="/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"/>"></script>
	<!-- jQuery Knob Chart -->
	<script src="<c:url value="/plugins/knob/jquery.knob.js"/>"></script>
	<!-- daterangepicker -->
	<script src="<c:url value="/dist/js/moment.min.js"/>"></script>
	<script
		src="<c:url value="/plugins/daterangepicker/daterangepicker.js"/>"></script>
	<!-- datepicker -->
	<script
		src="<c:url value="/plugins/datepicker/bootstrap-datepicker.js"/>"></script>
	<!-- Bootstrap WYSIHTML5 -->
	<script
		src="<c:url value="/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"/>"></script>
	<!-- Slimscroll -->
	<script
		src="<c:url value="/plugins/slimScroll/jquery.slimscroll.min.js"/>"></script>
	<!-- FastClick -->
	<script src="<c:url value="/plugins/fastclick/fastclick.min.js"/>"></script>
	<!-- AdminLTE App -->
	<script src="<c:url value="/dist/js/app.min.js"/>"></script>
	<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
	<script src="<c:url value="/dist/js/pages/dashboard.js"/>"></script>
	<!-- AdminLTE for demo purposes -->
	<script src="<c:url value="/dist/js/demo.js"/>"></script>
</body>
</html>
